<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option"/>
  </el-card>
</template>

<script>

import ColumnType from '@/framework/constant/ColumnType'
import PropertyTypeEnum from '@/feature/pdt/infra/constants/PropertyTypeEnum'
import YesNoEnum from '@/infra/constant/YesNoEnum'
import OnlineStatusEnum from '@/framework/constant/OnlineStatusEnum'
import InputTypeEnum from '@/feature/pdt/infra/constants/InputTypeEnum'
import SelectTypeEnum from '@/feature/pdt/infra/constants/SelectTypeEnum'
import ValueTypeEnum from '@/feature/pdt/infra/constants/ValueTypeEnum'
import ValueSourceEnum from '@/feature/pdt/infra/constants/ValueSourceEnum'
import { propertyApi } from '@/feature/pdt/infra/api/propertyApi'
import CURDTable from '@/framework/components/table/CURDTable'

export default {
  components: { CURDTable },
  data() {
    return {
      option: {
        requestApi: propertyApi,
        columns: [
          {
            label: '属性组ID',
            prop: 'groupId',
            searchable: true,
            type: ColumnType.SELECT
          },
          {
            label: '属性名称',
            prop: 'propertyName'
          },
          {
            label: '属性类型',
            prop: 'propertyType',
            type: ColumnType.RADIO,
            options: PropertyTypeEnum
          },
          {
            label: '是否必填',
            prop: 'requiredFlag',
            type: ColumnType.RADIO,
            options: YesNoEnum
          },
          {
            label: '状态',
            searchable: true,
            type: ColumnType.RADIO,
            hiddenInForm: true,
            options: OnlineStatusEnum,
            prop: 'status'
          },
          {
            label: '备注',
            prop: 'notes'
          },
          {
            label: '属性录入方式',
            prop: 'inputType',
            type: ColumnType.SELECT,
            options: InputTypeEnum
          },
          {
            label: '是否支持手动新增',
            prop: 'handAddFlag',
            type: ColumnType.RADIO,
            options: YesNoEnum
          },
          {
            label: '检索类型；0->不需要进行检索；1->关键字检索；2->范围检索',
            prop: 'searchType',
            type: ColumnType.NUMBER
          },
          {
            label: '属性选择类型',
            prop: 'selectType',
            type: ColumnType.RADIO,
            options: SelectTypeEnum
          },
          {
            label: '创建时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtCreate'
          },
          {
            label: '修改时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtModified'
          },
          {
            label: '提示信息',
            prop: 'bottomTip'
          },
          {
            label: '是否能备注',
            prop: 'canNoteFlag',
            type: ColumnType.RADIO,
            options: YesNoEnum
          },
          {
            label: '是否能长传图片',
            prop: 'uploadPicFlag',
            type: ColumnType.RADIO,
            options: YesNoEnum
          },
          {
            label: '属性值是否可排序',
            prop: 'valueCanSort',
            type: ColumnType.NUMBER
          },
          {
            label: '属性值单位',
            prop: 'valueUnit'
          },
          {
            label: '',
            prop: 'sortNum',
            type: ColumnType.NUMBER
          },
          {
            label: '',
            prop: 'chooseMaxNum',
            type: ColumnType.NUMBER
          },
          {
            label: '是否重要属性',
            prop: 'importantFlag',
            type: ColumnType.RADIO,
            options: YesNoEnum
          },
          {
            label: '最小值',
            prop: 'minValue'
          },
          {
            label: '最大值',
            prop: 'maxValue'
          },
          {
            label: '控件提示列表',
            prop: 'tipList'
          },
          {
            label: '属性值类型',
            prop: 'valueType',
            type: ColumnType.RADIO,
            options: ValueTypeEnum
          },
          {
            label: '正则匹配表达式',
            prop: 'regexCheckExp'
          },
          {
            label: '是否正则匹配',
            prop: 'regexCheckFlag',
            type: ColumnType.RADIO,
            options: YesNoEnum
          },
          {
            label: '',
            prop: 'feature',
            type: ColumnType.NUMBER
          },
          {
            label: '',
            prop: 'editableFlag',
            type: ColumnType.RADIO,
            options: YesNoEnum
          },
          {
            label: '精度',
            prop: 'valuePrecision',
            type: ColumnType.NUMBER
          },
          {
            label: '来源',
            prop: 'valueSource',
            type: ColumnType.RADIO,
            options: ValueSourceEnum
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

